<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ page contentType="text/html; charset=utf-8"  import="com.leexuan.ordersystem.beans.*" import="com.leexuan.ordersystem.*"  import="java.util.*"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="css/admincp.css" type=text/css rel=stylesheet>
<html:base/></HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD>订单管理&nbsp;>>&nbsp;查看订单明细</TD></TR></TBODY></TABLE><BR>
      <TABLE class=tableborder cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=3>客户信息</TD></TR>
          
<%

ArrayList arraylist = (ArrayList)session.getAttribute("orderdetail");

Order od = (Order)session.getAttribute("order");
Customer cs = (Customer)session.getAttribute("customer");

%>          


        <TR>
          <TD class=altbg1 width="20%">客户名称：</TD>
          <TD class=altbg2 align=right width="50%">
          <%=cs.getName()%>
          </TD>
          <td width="30%" align=left>
         </td>
          </TR>

        <TR>
          <TD class=altbg1>客户开户银行：</TD>
          <TD class=altbg2 align=right>
          <%=cs.getBank()%></TD>
          <td></td></TR>
        <TR>
          <TD class=altbg1>客户银行帐号：</TD>
          <TD class=altbg2 align=right>
          <%=cs.getAccount()%></TD>
          <td></td></TR>
        <TR>
          <TD class=altbg1>客户地址：</TD>
          <TD class=altbg2 align=right>
          <%=cs.getAddress()%></TD>  
          <td>          
          </td>   </TR>   
          
                                          
      </TBODY></TABLE><BR>

 
      <TABLE class=tableborder cellSpacing=0 cellPadding=0 width="100%" 
border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>订单信息</TD></TR>
        <TR>
          <TD class=altbg1 width="30%">订单编号：</TD>
          <TD class=altbg2 align=right>#<%=od.getOid()%></TD></TR>
        <TR>
          <TD class=altbg1 width="30%">定购日期：</TD>
          <TD class=altbg2 align=right><%=od.getDate()%></TD></TR>
        <TR>
          <TD class=altbg1>发货日期：</TD>
          <TD class=altbg2 align=right><%=od.getDdate()%></TD></TR>
        <TR>
          <TD class=altbg1>发货方式：</TD>
          <TD class=altbg2 align=right>
          <%=od.getDname()%>
		  </TD></TR>              
        <TR>
          <TD class=altbg1>订单总金额：</TD>
          <TD class=altbg2 align=right><%=od.getSum()%> 元</TD></TR>
        <TR>
          <TD class=altbg1>经办人：</TD>
                  
          <TD class=altbg2 align=right><%=od.getAname()%></TD></TR>
        <html:errors/>                                                              
      </TBODY></TABLE><BR>

<TABLE class=tableborder cellSpacing=0 cellPadding=0 width="100%" 
border=0 id="plist">
        <TBODY>
        
        <TR class=header>
          <TD width="8%">产品编号</TD>
          <TD width="8%">产品名称</TD>
          <TD width="15%">产品型号</TD>
          <TD width="8%">分类</TD>
          <TD width="8%">售价</TD>
          <TD width="8%">定购数量</TD>
          <TD width="10%">单项小计</TD>     
          <TD width="8%">已发数</TD>  
          <TD width="8%">待发数</TD>
          <TD>操作</TD></TR>        
<%



	Product[] pts  = new Product[arraylist.size()];
	arraylist.toArray(pts);
	for(int i=0;i<pts.length;i++){
%>		
        <TR align=middle>
          <TD class=altbg1><%=pts[i].getNumber()%></TD>
          <TD class=altbg2><%=pts[i].getName() %></TD>
          <TD class=altbg1><%=pts[i].getModel() %></TD>
          <TD class=altbg2><%=pts[i].getSname() %></TD>
          <TD class=altbg1><%=pts[i].getPrice() %> 元</TD>
          <TD class=altbg2><%=pts[i].getNum() %></TD>
          <TD class=altbg1><%=pts[i].getNum()*pts[i].getPrice() %> 元</TD>
          <TD class=altbg1><%=pts[i].getNum()-pts[i].getRemain() %></TD>
          <TD class=altbg1><%=pts[i].getRemain() %></TD>
          <TD>
          
          
          <%if(pts[i].getRemain() > 0){%>
          <html:form action="/addDeliver.do" method="post">
          <input type="text" name="quantity" value="<%=pts[i].getRemain()%>" size=5>
          <input type="hidden" name="odid" value=<%=pts[i].getOdid() %>>
          <input type="hidden" name="oid" value=<%=od.getOid()%>>
          <input type="hidden" name="pid" value=<%=pts[i].getPid() %>>
          <input type="hidden" name="remain" value=<%=pts[i].getRemain() %>>   
          <input type=submit value="发货">
          </html:form>
          <%}else{ %>
          	发货完毕
          <%}%>
          </TD>
          </TR>
          
          <%} %>


</TBODY></TABLE>    

<%
session.removeAttribute("order");
session.removeAttribute("customer");
session.removeAttribute("orderdetail");
%>
      
      <CENTER>
      <br><INPUT class=button type=button value="返回发货一览表" onclick="window.location.href='listDeliver.do';">
      <INPUT class=button type=button value="返回订单列表" onclick="window.location.href='listOrder.do';">
      </CENTER>	</TD></TR></TBODY></TABLE>

<%@include file= "./footer.jsp"%>
